package cn.xiuxius.embedded.config.validator;

import cn.xiuxius.embedded.config.EasyYamlConfig;
import cn.xiuxius.embedded.config.EasyYamlVersion;

public interface ConfigValidator {
    void validate(EasyYamlConfig config) throws IllegalArgumentException;

    static ConfigValidator getValidator(EasyYamlVersion version) {
        if (version == EasyYamlVersion.V1_0_0) {
            return new ValidatorV1_0_0();
        }
        if (version == EasyYamlVersion.V1_0_1) {
            return new ValidatorV1_0_1();
        }
        return new ValidatorV1_0_0();
    }
}
